let zta: string = "我是一个好学生";
zta = "学生";
const zta1: string = "我是一个好学生";
/*zta1 = "大学生";*//* const是常量类型所以不可再次赋值*/
console.log(zta);
let zarr: number[] = [3, 5, 4, 9];
let arr1: Array<number> = [3, 6, 9, 12];
let arrs: number = zarr.length;
let arr1s: number = arr1.length;
let a111: object = null;
declare function create(b: object | null): void;
create({ prop: 0 });
create(null);

var s: number = 1;
var v: number = 2;
var ss = s + v;
const sss: object = { "name": "周腾澳", "age": "21", "sex": "男" };

function zta2(x: number, y: number): number {
	return x + y;

}
function zta3(x: string, y: string): string {
	return "x" + "y";
}
zta3("你", "好");
function zta4(x: string, y: string | number, z?: string): string {
	return x + "" + y + "" + z;
}
zta4("Bob", "liang");
zta4("Bob", "aida", "Mr");

function buildNamezta(firstName: string, lastName = "smith") {
	return firstName + " " + lastName;
}
buildName("Bob");
function buildNamezta1(firstName: string, ...lastName: string[]): string {
	return firstName + "" + lastName.join("");

}
buildName2("Joseph", "Samuel", "Lucas", "MacKinzie");

function hard(x: string | number, y: string | number) {
	if (typeof x == "number" && typeof y == "number") {
		return x + y;
	} else {
		return x + "" + y;
	}
}
hard(7, 8);
hard(6, "号");
hard("月", "光");


